Multiprotocol label switching (MPLS) provides a technique for routing packet data based on a label field rather than a destination address. An MPLS network comprises a set of nodes, which are called label switched routers (LSRs), that switch/route packets based on a label that has been added to each packet. Labels are used to define a flow of packets between two nodes or, if packets are being broadcast in a multicast operation, between a source node and multiple destination nodes. A specific path through the LSRs called a label switched path (LSP) is defined for each distinct flow, which is called a forwarding equivalence class (FEC). At intervening nodes in an LSP, an LSR may route the packet based on the MPLS label value, remove the MPLS label (pop a label), and/or impose an additional label (push a label). The label may be removed at the node from the packet at a node that is just prior to the destination node in a particular LSP. This process is sometimes referred to as “penultimate hop popping.”
Referring now to FIG. 1, an exemplary MPLS label and Internet Protocol (IP) packet are illustrated. The MPLS label is a 32-bit header that includes a 20-bit label field, a 3-bit Exp field that is reserved for experimental use, a 1-bit S field that is set to one for the oldest entry in the stack and zero for all other entries, and an 8-bit time-to-live (TTL) field that may be used to encode a hop count or time-to-live value. An MPLS label may also be referred to as an MPLS shim header. As shown in FIG. 1, multiple MPLS labels or shim headers may be included in a single IP packet. The MPLS labels or shim headers are organized as a last-in, first-out stack and are processed based on the top MPLS label or shim header. As discussed above, an LSR may add an MPLS label or shim header to the stack (push operation) or remove an MPLS label or shim header from the stack (pop operation).